package com.ruoyi.user.mapper;

import com.ruoyi.user.domain.UserOrders;
import com.ruoyi.user.domain.vo.OrderListItemVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserOrdersMapper {
    UserOrders selectOrdersByOrderId(@Param("orderId") Long orderId);
    List<UserOrders> selectOrdersList(UserOrders orders);
    int insertOrders(UserOrders orders);
    int updateOrders(UserOrders orders);
    /**
     * 取消超过15分钟仍未支付且为待接单状态的订单
     * @return 受影响行数
     */
    int cancelUnpaidOrdersOlderThan15m();

    List<OrderListItemVO> selectOrderSummariesByCustomerId(@Param("customerId") Long customerId);
    List<OrderListItemVO> selectOrderSummariesByStatus(@Param("customerId") Long customerId, @Param("status") Integer status);
    int countOrdersByMerchantLastMonth(@Param("merchantId") Long merchantId);
}
